package com.longcai.piaojia.conn;

import com.zcx.helper.http.AsyCallBack;
import com.zcx.helper.http.note.HttpInlet;

import org.json.JSONObject;

/**
 * Created by Administrator on 2016/11/16.
 */
@HttpInlet(Conn.INDEX_VERSION_WEB)
public class UpdateAppGet extends BaseAsyGet<UpdateAppGet.UpdateAppEntity> {

    public int category = 1, versionNum;

    public UpdateAppGet(AsyCallBack<UpdateAppEntity> asyCallBack) {
        super(asyCallBack);
    }

    @Override
    protected UpdateAppEntity parser(JSONObject object) throws Exception {

        if(object.optInt("code")==200){


            UpdateAppEntity updateAppEntity = new UpdateAppEntity();
            updateAppEntity.constraint = object.optInt("constraint");
            updateAppEntity.url = object.optString("url");

            return updateAppEntity;

        }

        TOAST = object.optString("message");

        return null;
    }

    public static class UpdateAppEntity{

        public int constraint;
        public String url;

    }

}
